#include "fifo.h"



void Enqueue(Queue *q,char c)
{
    q->Buffer[q->Tail] = c;
    q->Tail = (q->Tail + 1) % QUEUE_SIZE;
}

char Dequeue(Queue *q)
{
    char ret = q->Buffer[q->Head];
    q->Head = (q->Head + 1) % QUEUE_SIZE;
    return ret;
}

int IsQueueEmpty(Queue *q)
{
    return (q->Head == q->Tail);
}
int IsQueueFull(Queue *q)
{
    return (((q->Tail + 1) % QUEUE_SIZE) == q->Head);
}
